package com.hdu.service;

import com.hdu.common.Result;
import com.hdu.pojo.User;

import javax.servlet.http.HttpSession;
import java.util.List;

public interface UserService {
    boolean addUser(User user);
    boolean updateUser(User user);
    boolean deleteUser(Integer id);
    User getUserById(Integer id);

    User getUserByName(String username);
    List<User> getAllUsers();

    int countByUsername(String username);

    boolean login(String username, String password);

    boolean register(String username,String password);

    boolean generateCode(String phone, HttpSession session);

    boolean confirmCode(String phone, String code);

    Result<String> loginByPhone(String phone,String code);
}